package com.tian.clothing.module.login;

import android.view.KeyEvent;
import android.view.View;

import com.jd.open.sdk.android.util.Log;
import com.tian.clothing.R;
import com.tian.clothing.base.BaseActivity;
import com.tian.clothing.util.DialogUtil;
import com.tian.clothing.widget.TitleBar;

/**
 * @ClassName: LoginActivity
 * @Description: 登录界面
 * @author: dreamfutureba@gmail.com
 * @date: 2013年11月25日 下午2:48:50
 */
public class LoginActivity extends BaseActivity{
	private static final String TAG=LoginActivity.class.getSimpleName();
	
	@Override
	protected void installViews() {
		setContentView(R.layout.activity_login);
		
	}

	@Override
	protected void registerEvents() {
		// TODO Auto-generated method stub
		
	}
	
	@Override
	protected void initTitleBar() {
		mTitleBar.changeStyle(TitleBar.TITLEBAR_STYLE.ONE_TITLE_STYLE);
		mTitleBar.titlebar_tv_center.setText("登录");
		mTitleBar.titlebar_btn_right.setVisibility(View.VISIBLE);
		mTitleBar.titlebar_btn_right.setText("注册");
		super.initTitleBar();
	}
	
	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if (isFinishing()) {
			return true;
		}
		if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
			DialogUtil.newExitDialog(mContext).show();
			Log.e(TAG, "KEYCODE_BACK has clicked...");
		}
		return super.onKeyDown(keyCode, event);
	}

}
